package neu.soft.feignclient;

import neu.soft.entity.NormalOrder;
import neu.soft.vo.ResultBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

/**
 * 服务降级处理，采用工厂方式，方便异常处理，优先级要高于统一异常处理
 */
@Component
@FeignClient(value = "dispatch-server",fallbackFactory = DispatchFeignClientFallBackFactory.class)
public interface DispatchFeignClient {


    @RequestMapping("/orderInquire/findPrintOrder")
    ResultBean<Map<String, Object>> findPrintOrder(@RequestBody String orderId);

    @RequestMapping("/distributionTaskOrder/autoCreateDistributionTaskOrder")
    ResultBean DistributionTaskOrder(@RequestBody NormalOrder normalOrder);

    @RequestMapping("/stateUpdate/statusUpdate")
    ResultBean statusUpdate(@RequestBody Map<String, Object> map);

    @RequestMapping("/orderInquire/findShopping")
    ResultBean<List<Map<String,Object>>> findShopping(@RequestBody String orderId);

}
